#include<bits/stdc++.h>
using namespace std;

int n,ma,mi,r[100100],cnt;

int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    mi=100001;
    for(int i=1;i<=n;i++)
    {
        int x;
        cin>>x;
        r[x]++;
        ma=max(ma,x);
        mi=min(mi,x);
    }
    cnt=r[mi];
    for(int i=mi+1;i<=ma;i++)
    {
        if(r[i]==0)continue;
        if(cnt<=r[i])
        {
            n-=cnt;
            cnt=r[i];
        }
        else n-=r[i];
    }
    cout<<n;
    return 0;
}
